local xiaye = fk.CreateSkill {
  name = "water_xiaye",
}

Fk:loadTranslationTable{
  ["water_xiaye"] = "下野",
  [":water_xiaye"] = "你造成伤害/受到伤害后摸等同于伤害值的牌，然后你可将黑色牌当【顺手牵羊】、红色牌当【无中生有】使用。",
  ["#water_xiaye_snatch"] = "下野：你可以将一张黑色牌当【顺手牵羊】使用（本回合限一次）",
  ["#water_xiaye_exnihilo"] = "下野：你可以将一张红色牌当【无中生有】使用（本回合限一次）",
}

-- 造成或受到伤害后，摸等量牌
xiaye:addEffect(fk.Damage, {
  anim_type = "support",
  can_trigger = function(self, event, target, player, data)
    return player == target and player:hasSkill(self.name)
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    player:drawCards(data.damage, self.name)
    room:askToUseVirtualCard(player, {
      name = "snatch",
      skill_name = xiaye.name,
      prompt = "#water_xiaye_snatch",
      cancelable = true,
      extra_data = {
        bypass_times = true,
        extraUse = true,
      },
      card_filter = {
        n = 1,
        pattern = ".|.|spade,club",
      },
    })
    room:askToUseVirtualCard(player, {
      name = "ex_nihilo",
      skill_name = xiaye.name,
      prompt = "#water_xiaye_exnihilo",
      cancelable = true,
      extra_data = {
        bypass_times = true,
        extraUse = true,
      },
      card_filter = {
        n = 1,
        pattern = ".|.|heart,diamond",
      },
    })
    
  end,
})





return xiaye 